home *** CD-ROM | disk | FTP | other *** search
- 'Script to test getting/setting reference point of the graphic
-
- Option Explicit
-
- Dim tcApp
-
- sub ShowRefPoint(tcGr, bUseWorldCS)
-
- Dim tcVrtRef
- Dim strMsg
-
- Set tcVrtRef = tcGr.ReferencePoint(bUseWorldCS)
-
- strMsg = "RefPoint of " & CStr(tcGr.ID)
- strMsg = strMsg & Chr(13) & Chr(10)
-
- strMsg = strMsg & "X = " & CStr(tcVrtRef.X)
- strMsg = strMsg & Chr(13) & Chr(10)
-
- strMsg = strMsg & "Y = " & CStr(tcVrtRef.Y)
- strMsg = strMsg & Chr(13) & Chr(10)
-
- strMsg = strMsg & "Z = " & CStr(tcVrtRef.Z)
- strMsg = strMsg & Chr(13) & Chr(10)
-
- if (Not bUseWorldCS) then
- strMsg = strMsg & "(Local CS)"
- else
- strMsg = strMsg & "(World CS)"
- end if
-
- msgBox strMsg
- end sub
-
- Sub EditRefPoint(tcGr)
-
- Dim tcVrtRef
-
-
- ShowRefPoint tcGr, false
- ShowRefPoint tcGr, true
-
- Set tcVrtRef = tcGr.ReferencePoint
-
- tcVrtRef.X = tcVrtRef.X + 1
- tcVrtRef.y = tcVrtRef.y + 1
- tcVrtRef.z = tcVrtRef.z + 1
-
- ShowRefPoint tcGr, false
-
-
- end sub
-
- Sub UpdateSelector()
-
- Dim tcSel
-
- Set tcSel = tcApp.Selection
- if (tcSel.Count = 0) then exit sub
-
- tcSel(0).Select
-
-
- end sub
-
-
- Sub Main()
-
- Dim tcDwg
- Dim tcGrs
- Dim tcGr
-
- Set tcDwg = tcApp.ActiveDrawing
-
- Set tcGrs = tcDwg.Graphics
-
- for each tcGr in tcgrs
- EditRefPoint(tcGr)
- next
-
- UpdateSelector
-
- end sub
-
- Set tcApp = CreateObject("TurboCAD.Application")
- tcApp.Visible = True
-
- Main
-
- MsgBox "Done"
-